.pragma library

Qt.include("Database.js")

//ウインドウ
var SETTING_KEY_MAIN_WINDOW_WIDTH = "MAIN_WINDOW_WIDTH";
var SETTING_KEY_MAIN_WINDOW_HEIGHT = "MAIN_WINDOW_HEIGHT";

// 一般設定
var SETTING_KEY_GENERAL_UPDATE_INTERVAL = "GENERAL_UPDATE_INTERVAL";
var SETTING_KEY_GENERAL_INREPLYTO_COUNT_MAX = "GENERAL_INREPLYTO_COUNT_MAX";


// メインウインドウの横幅取得
function getMainWindowWidth(){
    var w = readData(SETTING_KEY_MAIN_WINDOW_WIDTH);
    if(w === undefined){
        w = 300;
    }else{
        if(w < 300){
            w = 300;
        }
    }
    return w;
}
// メインウインドウの横幅を保存
function setMainWindowWidth(w){
    saveData(SETTING_KEY_MAIN_WINDOW_WIDTH, w);
}

// メインウインドウの高さ取得
function getMainWindowHeight(){
    var h = readData(SETTING_KEY_MAIN_WINDOW_HEIGHT);
    if(h === undefined){
        h = 300;
    }else{
        if(h < 300){
            h = 300;
        }
    }
    return h;
}
// メインウインドウの高さを保存
function setMainWindowHeight(h){
    saveData(SETTING_KEY_MAIN_WINDOW_HEIGHT, h);
}

// 更新間隔
function getUpdateInterval(){
    var interval = readData(SETTING_KEY_GENERAL_UPDATE_INTERVAL);
    if(interval === undefined){
        interval = 60;
    }else if(interval < 30){
        interval = 30;
    }else{
    }
    return interval;
}
// 更新間隔
function setUpdateInterval(interval){
    saveData(SETTING_KEY_GENERAL_UPDATE_INTERVAL, interval);
}

// in reply toの取得回数
function getInReplyToCountMax(){
    var count = readData(SETTING_KEY_GENERAL_INREPLYTO_COUNT_MAX);
    if(count === undefined){
        count = 4;
    }else if(count < 1){
        count = 4;
    }else{
    }
    return count;
}
function setInReplyToCountMax(count){
    saveData(SETTING_KEY_GENERAL_INREPLYTO_COUNT_MAX, count);
}
